package com.sojson.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.sojson.dao.CouponUserDao;
import com.sojson.entity.po.CouponUser;
import com.sojson.service.CouponUserService;

/**
 * 券可用用户Service实现类
 * 
 * @author liu
 * @date 2021-06-02
 */
@Service
public class CouponUserServiceImpl implements CouponUserService {

    @Resource
    private CouponUserDao couponUserDaoImpl;

    /**
     * 单条插入
     * 
     * @param couponUser
     * @return
     */
    @Override
    public int insert(CouponUser couponUser) {
        int insert = couponUserDaoImpl.insert(couponUser);
        return insert;
    }

    /**
     * 批量插入
     * 
     * @param couponUser
     * @return
     */
    @Override
    public int insertList(CouponUser couponUser) {
        int insertList = couponUserDaoImpl.insertList(couponUser.getCouponUsers());
        return insertList;
    }

    /**
     * 通过对象批量删除(物理删除)
     * 
     * @param couponUser
     * @return
     */
    @Override
    public int deleteByDto(CouponUser couponUser) {
        int deleteByDto = couponUserDaoImpl.deleteByDto(couponUser);
        return deleteByDto;
    }

    /**
     * 统计全部数量
     * 
     * @return
     */
    @Override
    public int countAll() {
        int countAll = couponUserDaoImpl.countAll();
        return countAll;
    }

    /**
     * 查询所有
     * 
     * @return
     */
    @Override
    public List<CouponUser> listAll() {
        List<CouponUser> findAll = couponUserDaoImpl.listAll();
        return findAll;
    }

    /**
     * 根据对象统计数量
     * 
     * @param couponUser
     * @return
     */
    @Override
    public int countByDto(CouponUser couponUser) {
        int countByDto = couponUserDaoImpl.countByDto(couponUser);
        return countByDto;
    }

    /**
     * 根据对象查询
     * 
     * @param couponUser
     * @return
     */
    @Override
    public List<CouponUser> listByDto(CouponUser couponUser) {
        List<CouponUser> findByDto = couponUserDaoImpl.listByDto(couponUser);
        return findByDto;
    }

    /**
     * 通过id删除(物理删除)
     * 
     * @param id
     * @return
     */
    @Override
    public int deleteById(Integer id) {
        int deleteById = couponUserDaoImpl.deleteById(id);
        return deleteById;
    }

    /**
     * 通过id数组删除(物理删除)
     * 
     * @param ids
     * @return
     */
    @Override
    public int deleteByIds(Integer[] ids) {
        int deleteByIds = couponUserDaoImpl.deleteByIds(ids);
        return deleteByIds;
    }

    /**
     * 通过id更新(全部更新)
     * 
     * @param couponUser
     * @return
     */
    @Override
    public int updateAllById(CouponUser couponUser) {
        int updateAllById = couponUserDaoImpl.updateAllById(couponUser);
        return updateAllById;
    }

    /**
     * 通过id列表更新(全部更新)(更新内容相同)
     * 
     * @param couponUser
     * @return
     */
    @Override
    public int updateAllByIdList(CouponUser couponUser) {
        int updateAllByIdList = couponUserDaoImpl.updateAllByIdList(couponUser);
        return updateAllByIdList;
    }

    /**
     * 通过id列表更新(全部更新)(更新内容不相同)
     * 
     * @param couponUser
     * @return
     */
    @Override
    public int updateDtoListAllById(CouponUser couponUser) {
        int updateDtoListAllById = couponUserDaoImpl.updateDtoListAllById(couponUser.getCouponUsers());
        return updateDtoListAllById;
    }

    /**
     * 通过id更新(局部更新)
     * 
     * @param couponUser
     * @return
     */
    @Override
    public int updateById(CouponUser couponUser) {
        int updateById = couponUserDaoImpl.updateById(couponUser);
        return updateById;
    }

    /**
     * 通过id列表更新(局部更新)(更新内容相同)
     * 
     * @param couponUser
     * @return
     */
    @Override
    public int updateByIdList(CouponUser couponUser) {
        int updateByIdList = couponUserDaoImpl.updateByIdList(couponUser);
        return updateByIdList;
    }

    /**
     * 通过id列表更新(局部更新)(更新内容不相同)
     * 
     * @param couponUser
     * @return
     */
    @Override
    public int updateDtoListById(CouponUser couponUser) {
        int updateDtoListById = couponUserDaoImpl.updateDtoListById(couponUser.getCouponUsers());
        return updateDtoListById;
    }

    /**
     * 通过id查询
     * 
     * @param id
     * @return
     */
    @Override
    public CouponUser findById(Integer id) {
        CouponUser findById = couponUserDaoImpl.findById(id);
        return findById;
    }

    /**
     * 通过id数组查询
     * 
     * @param ids
     * @return
     */
    @Override
    public List<CouponUser> findByIds(Integer[] ids) {
        List<CouponUser> findByIds = couponUserDaoImpl.findByIds(ids);
        return findByIds;
    }

    /**
     * 通过对象查询id列表
     * 
     * @param couponUser
     * @return
     */
    @Override
    public List<Integer> findIdByDto(CouponUser couponUser) {
        List<Integer> findIdByDto = couponUserDaoImpl.findIdByDto(couponUser);
        return findIdByDto;
    }

    /**
     * 清空数据(物理清空)
     */
    @Override
    public int clear() {
        return couponUserDaoImpl.clear();
    }

    /**
     * 根据对象查询
     * 
     * @param couponUser
     * @return
     */
    @Override
    public List<CouponUser> list(CouponUser couponUser) {
        return couponUserDaoImpl.list(couponUser);
    }

}